<template>
<div>
  <div>
    <van-nav-bar
        title="热门话题"
        left-text="返回"
        left-arrow
        @click-left="onClickLeft()"
    />
  </div>

  <div style="margin: 5%">
    <label style="font-size: 30px;font-weight: bold;">{{this.message.title}}</label> <label style="margin-left: 20px">热度：{{this.message.heat}}</label>
  </div>
  <div class="ry-nr">
    <label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{this.message.info}}</label>
  </div>

  <div style="text-align: right;margin: 10%">
    <label>话题日期：{{this.message.ctime}}</label>
  </div>
</div>
</template>

<script>
export default {
  name: "CommunityHeartView",
  data(){
    return{
      message:{
        // id:'',
        title:'测试热议标题',
        heat:'测试热议热度',
        info:'测试热议内容',
        ctime:'测试热议2202-2-2'
      }
    }
  },mounted(){
    //接受VueX中储存的这条热议的id信息
    this.id=this.$store.state.topicId;
    this.loadData();
  },
  methods:{
    onClickLeft(){
       history.back()
    },
    loadData(){
      //点击之后热议详细信息的请求接口
      this.axios.get("/api/topic/selectOne.do?id="+this.id).then(r=>{
        if(r.data.code==200){
          this.message=r.data.data;
        }
      });
    },
  }
}
</script>

<style scoped>
.ry-nr{
  width: 80%;
  margin: 10%;
  text-align: left;

}
</style>
